home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / tcp / NNTPspool.lha / NNTPspool < prev    next >
Text File  |  1995-07-12  |  2KB  |  91 lines

  1. /* 
  2.  
  3.   $VER: NNTPspool 1.0 (20.05.95) by Piergiorgio Ghezzo
  4.  
  5.  This script allow you to maintain a news article spooler
  6.  with NNTPpost.
  7.  
  8. */
  9.  
  10. OPTIONS FAILAT 50
  11.  
  12. SpoolFile  = "AMITCP:NewsSpool/News."  /* The spool filename without extension (full path) */
  13. PostNews   = "AMITCP:Bin/NNTPpost"     /* The news article post program */
  14. CopyCmd    = "C:Copy >NIL:"            /* The copy program */
  15. DelCmd     = "C:Delete >NIL:"          /* The delete program */
  16.  
  17. parse arg FileName Mode .
  18.  
  19. if FileName = "?" then call usage
  20.  
  21. if FileName = ""
  22.    then call send
  23.    else call archive
  24.  
  25. EXIT 0
  26.  
  27.  
  28.  
  29. /*** Spedisce i files presenti nello spool ******************************/
  30. Send:
  31.  
  32. Ciclo  = 0
  33. Uscita = 0   /*** Dopo cinque tentativi esce ***/
  34.  
  35. SAY "0A"x"Spedisco i messaggi presenti nello spooler..."
  36. DO WHILE(Uscita < 5)
  37.    Final = SpoolFile || Ciclo
  38.    Ciclo = Ciclo + 1
  39.    IF EXISTS(Final)
  40.       THEN DO
  41.            Uscita = 0
  42.            ADDRESS COMMAND PostNews Final
  43.            IF RC ~= 0
  44.               THEN DO
  45.                    SAY "0A"x"Non posso spedire la posta!"
  46.                    EXIT 10
  47.                    END
  48.            ADDRESS COMMAND DelCmd Final
  49.            END
  50.       ELSE Uscita = Uscita + 1
  51.    END
  52. SAY "Fatto!"||"0A"x
  53.  
  54. RETURN
  55.  
  56.  
  57. /*** Archivia il file da spedire nello spool ****************************/
  58. Archive:
  59.  
  60. Ciclo  = 0
  61. Uscita = n
  62.  
  63. ADDRESS COMMAND PostNews FileName
  64. IF RC ~= 0
  65.    THEN DO
  66.         DO WHILE(Uscita = n)
  67.            Final = SpoolFile || Ciclo
  68.            IF EXISTS(Final)
  69.               THEN Ciclo = Ciclo + 1
  70.               ELSE Uscita = y
  71.            END
  72.         ADDRESS COMMAND CopyCmd FileName Final
  73.         END
  74.  
  75. IF Mode ~= "NODELETE"
  76.    THEN ADDRESS COMMAND DelCmd FileName
  77.  
  78. RETURN
  79.  
  80. /*** Informazioni e aiuto ***********************************************/
  81. Usage:
  82.  
  83. SAY "0A"x"NNTPspool v1.0 - by Piergiorgio Ghezzo"
  84. SAY "                 A spooler for your articles!"
  85. SAY "0A"x"Usage:  NNTPspool <FileName> [NODELETE] - Queue the article."
  86. SAY "                                          If NODELETE isn't specified,"
  87. SAY "                                          delete the source file."||"0A"x
  88. SAY "        NNTPspool                       - Send the files in the spool"||"0A"x
  89.  
  90. EXIT 0
  91.